#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
vector<int> q;
int ret = 0;
int main() {
    int m, n;
    cin >> m >> n;
    for(int i = 0; i < n; i++) {
        int temp;
        cin >> temp;
        auto it = find(q.begin(), q.end(), temp);
        if(it == q.end()) {
            if(q.size() >= m) {
            q.erase(q.begin());
            }
            q.push_back(temp);
            ret++;
        }
    }
    cout << ret;
    return 0;
}